package com.example.administrator.footballgamecollectandanalyze;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import adapter.MyteamAdapter;
import bean.Myteam;

public class MyTeam extends AppCompatActivity {
    private List<Myteam> myteamList = new ArrayList<Myteam>() ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_team);
        initMyteam();
        MyteamAdapter adapter =new MyteamAdapter(MyTeam.this,R.layout.myteam_item,myteamList);

        ListView listView = (ListView)findViewById(R.id.MyTeam_view);

        listView.setAdapter(adapter);

    }

    private void initMyteam(){
        Myteam aa = new Myteam();
        aa.setTeamName("aaa");
        aa.setRecord("5胜3平1负");
        aa.setAve_Age("25");
        aa.setWin("60%");

        Myteam bb = new Myteam();
        bb.setTeamName("aaa");
        bb.setRecord("5胜3平1负");
        bb.setAve_Age("25");
        bb.setWin("60%");

        myteamList.add(aa);
        myteamList.add(bb);
    }
}
